<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../../common/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<sfa:mainTitle></sfa:mainTitle>
		<%@ include file="../../common/meta.jsp"%>


		<style type="text/css">
* {
	margin: 0;
	padding: 0;
}

.tc_box {
	width: 400px;
	height: 200px;
	border: 2px solid red;
	position: absolute;
	z-index: 2000;
	background: #FFC;
	display: none;
}

.sp_box {
	width: 100%;
	position: absolute;
	z-index: 1000;
	background: #000;
	top: 0;
	left: 0;
	display: none;
}
</style>

		<style>
.main .formdiv {
	width: 400px;
}
</style>
		<script type="text/javascript">
		jQuery.validator.addMethod("loginname", function(value, element) {   
    var tel = /^[a-zA-Z][a-zA-Z0-9_]{4,16}$/;
    return this.optional(element) || (tel.test(value));
}, "");

jQuery.validator.addMethod("password", function(value, element) {   
    var tel =/^[\da-zA-Z=\[\];`',.\/~!@#$%^&*()_+|{}:"<>?]{4,16}$/;
    return this.optional(element) || (tel.test(value));
}, "");

jQuery.validator.addMethod("phonenumber", function(value, element) {   
    var tel = /^(13[0-9]|15[0|3|6|7|8|9]|18[3|6|7|8|9])\d{8}$/;
    return this.optional(element) || (tel.test(value));
}, "");

$(function() {
	
	$("#clear").click(function(){
		$(".inputbox").val("");
	});
	$("#addUserForm").validate( {
		rules : {
			loginName : {
				required : true,
				rangelength:[5,16],
				loginname:true
			},
			userPassword : {
				required : true,
				rangelength: [5,16],
				password:true
			},
			userPassword2 : {
				required : true,
				equalTo:"#userPassword"
			},
			userName : {
				required : true
			},
			email : {
				required : true,
				email:true
			},
			contactMobile : {
				phonenumber:true
			}
			
		},
		 messages:{
                loginName:{required:"",rangelength:""},
                userPassword:{required:"",rangelength:"",password:""},
                userPassword2:{required:"",rangelength:"",equalTo:""},
                userName:{required:""},
                email:{required:"",email:""},
                contactMobile:{required:"",phonenumber:""},
                focusInvalid: false,   
 				onkeyup: false //获得焦点时不验证
 				}
	});


});
</script>
	</head>



	<body id="master">

		<sfa:mainHeader></sfa:mainHeader>
		<div class="main">
			<span class="pageTitle"> 新增助理 </span>
			<font color="red"><c:out value="${add}"></c:out> </font>
			<hr />


			<div class="in">
				<form id="addUserForm"
					action="${pageContext.request.contextPath }/manage/role/index/add"
					method="post">
					<table width="667" border="0" cellspacing="0" cellpadding="10"
						class="form_table">
						<tbody>
						
							<tr>
								<td class="table_title">
									创建人:
								</td>
								<td class="table_con">
									${user.userName}(${user.loginName})
									<input type="hidden" class="inputbox" id="userAgentId"
										name="userAgentId">
										
								</td>
							</tr>

							


							<tr>
								<td class="table_title">
									用户名:
								</td>
								<td class="table_con">
									<input type="text" class="inputbox" id="loginName"
										name="loginName" value="${adduser.loginName}"/>
										*长度为5到16位,以字母开头，由字母，数字下划线组成<font color="red">${name}</font>
								</td>
							</tr>
							<tr>
								<td class="table_title">
									密&nbsp;&nbsp;码:
								</td>
								<td class="table_con">
									<input type="password" class="inputbox" id="userPassword"
										name="userPassword" value="${adduser.userPassword}"/>
										*长度为5到16位,由字母，数字，特殊字符组成<font color="red">${pass}</font>
								</td>
							</tr>
							<tr>
								<td class="table_title">
									确认密码:
								</td>
								<td class="table_con">
									<input type="password" class="inputbox" id="userPassword2"
										name="userPassword2" value="${userPassword2Form}"/>
										*与密码的值相同<font color="red">${password1}</font>
								</td>
							</tr>
							<tr>
								<td class="table_title">
									用户姓名:
								</td>
								<td class="table_con">
									<input type="text" class="inputbox" id="userName"
										name="userName" value="${adduser.userName}"/>
										*<font color="red">${userName}</font>
								</td>
							</tr>
							<tr>
								<td class="table_title">
									电子邮件:
								</td>
								<td class="table_con">
									<input type="text" class="inputbox" id="email" name="email" value="${adduser.email}"/>
									*格式如：xxxx@xx.com<font color="red">${email}</font>
								</td>
							</tr>
							<tr>
								<td class="table_title">
									手机号码:
								</td>
								<td class="table_con">
									<input type="text" class="inputbox" id="contactMobile"
										name="contactMobile" value="${adduser.contactMobile}"/>
										格式如：138********<font color="red">${contact}</font>
								</td>
							</tr>
							<tr>
								<td class="table_title">

								</td>
								<td class="table_con">
									<input name="submit" type="submit" id="submit" tabindex="5"
										class="com_btn" value="提交">
									<input name="clear" type="button" id="clear" tabindex="5"
										class="com_btn" value="清空">
								</td>
							</tr>
						</tbody>
					</table>
				</form>
			</div>

			<div class="sp_box"></div>
		</div>
		<sfa:mainFooter></sfa:mainFooter>
	</body>
</html>


